import axios from './index'
const preUrl = ''

const article = {
  uploadArticle: {
    r: (params, config) => {
      return axios.post(`${preUrl}/article/insert`, params, config)
    }
  },
  getArticleList: {
    r: params => {
      return axios.get(`${preUrl}/article/list`, { params })
    }
  }
}

const hero = {

  uploadHero: {
    r: (params, config) => {
      return axios.post(`${preUrl}/hero/insert`, params, config)
    }
  },
  getHeroList: {
    r: (params) => {
      return axios.get(`${preUrl}/hero/list`, { params })
    }
  },
  uploadSkill: {
    r: (params, config) => {
      return axios.post(`${preUrl}/skill/insert`, params, config)
    }
  },
  uploadHeroEquipRel: {
    r: (params, config = {}) => {
      return axios.post(`${preUrl}/equipment/relation`, params, config)
    }
  },
  uploadHeroInsRel: {
    r: (params, config = {}) => {
      return axios.post(`${preUrl}/ins/relation`, params, config)
    }
  },
}

const ins = {
  uploadInscription: {
    r: (params, config) => {
      return axios.post(`${preUrl}/ins/insert`, params, config)
    }
  },
  getInsList: {
    r: (params) => {
      return axios.get(`${preUrl}/ins/list`, { params })
    }
  },
  getInsTypeList: {
    r: (params) => {
      return axios.get(`${preUrl}/ins/list`, { params })
    }
  },
  getInsInfo: {
    r: (params) => {
      return axios.get(`${preUrl}/ins/info/${params.id}`)
    }
  },
}

const equip = {
  uploadHeroEquipment: {
    r: (params, config) => {
      return axios.post(`${preUrl}/equipment/insert`, params, config)
    }
  },
  getEquipList: {
    r: (params) => {
      return axios.get(`${preUrl}/equipment/list`, { params })
    }
  }
}

export {
  article,
  hero,
  ins,
  equip
}